package cn.wei.youvie.domain.vo;

import cn.wei.youvie.domain.entity.Section;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
public class SectionVO implements Serializable {

    private Integer sectionId;

    /**
     * 章节的 ID，关联 chapter 表
     */
    private Integer chapterId;

    /**
     * 章节编号，用于章节排序
     */
    private Integer sectionNumber;

    /**
     * 章节标题
     */
    private String title;

    /**
     * 段落内容
     */
    private String content;

    public static SectionVO objToVo(Section section) {
        SectionVO vo = new SectionVO();
        BeanUtils.copyProperties(section, vo);
        return vo;
    }
}
